﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
namespace g1
{
    public partial class Form1 : Form
    {
        Crawler myCrawler = new Crawler();
        public Form1()
        {
            InitializeComponent();
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            myCrawler.startUrl = txt_start.Text;

            new Thread(myCrawler.Crawl).Start();//开始爬行
            lb_crawl.Text = "爬取中......";
            while (!myCrawler.end)
            {
                txt_urls.Text = myCrawler.message1;
                txt_errors.Text = myCrawler.message2;
            }
            lb_crawl.Text = "爬取结束";
        }
    }
}
